﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace Dsl.Ped.Editor.Modules.ErrorArea
{
    /// <summary>
    /// Interaction logic for ErrorAreaView.xaml
    /// </summary>
    public partial class ErrorAreaView : UserControl
    {
        #region Fields

        /// <summary>
        /// View model of the view
        /// </summary>
        private ErrorAreaViewModel viewModel;

        #endregion

        #region Members

        /// <summary>
        /// Gets or sets the view model of the view
        /// </summary>
        public ErrorAreaViewModel ViewModel
        {
            get
            {
                return viewModel;
            }
            set
            {
                viewModel = value;
                DataContext = viewModel;
            }
        }

        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorAreaView"/> class.
        /// </summary>
        /// <param name="reloadFileAction">The action for the reload of a file</param>
        public ErrorAreaView(Action reloadFileAction)
        {
            InitializeComponent();
            // Set the view model of the view
            ViewModel = new ErrorAreaViewModel(reloadFileAction);
        }
    }
}
